<?php
include_once ('class/autoload.php'); // pour inclure nos classes
include_once ('class/config.inc.php');
$site = new page_securisee ( 'accueil' );
global $connexion;
$requete = 'SELECT id, CONCAT(Nvoie," ", Lvoie," ", CP," ",Ville," ",PAYS) as adresse FROM cabinet WHERE Lvoie<>""';
$requete2='UPDATE cabinet SET lat=:lat, lng=:lng WHERE id=:id';
$data = $connexion->query ( $requete );
$update = $connexion->prepare($requete2);
$rows = array ();
$coord=array();
while ( $r = $data->fetch (PDO::FETCH_OBJ) ) {
	$coord=getLatLong($r->adresse);
	$update->execute(array(":lat"=>$coord['lat'], ":lng"=>$coord['lng'], ":id"=>$r->id));
}
echo true;
?>